package com.addplus.game_netty;

import com.addplus.game_netty.connect.NettyConfig;
import com.addplus.game_netty.connect.TCPServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class GameNettyApplication {

	public static void main(String[] args) throws Exception {
		ConfigurableApplicationContext context = SpringApplication.run(GameNettyApplication.class, args);
		//注入NettyConfig 获取对应Bean
		NettyConfig nettyConfig = context.getBean(NettyConfig.class);
		//注入TCPServer 获取对应Bean
		TCPServer tcpServer = context.getBean(TCPServer.class);
		//启动websocket的服务
		tcpServer.start();
	}

}
